package com.springcloud.register_user2.controller;

import com.springcloud.register_user2.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

/**
 * com.springcloud.register_user2.controller;
 * 功能：;
 *
 * @author 李冉 Email:1828581413@qq.com
 * Time:2018/4/5 20:01
 */
@RestController
public class UserController {
    @GetMapping("/user/{username}")
    public User getUser(@PathVariable("username") String username){
        System.out.println("访问register2");
        LocalDate localDate = LocalDate.now();
        System.out.println(localDate.toString());
        User user=new User();
        user.setId(111);
        user.setUsername("aaa");
        user.setPassword("aaa");
        if(username.equals(user.getUsername())){
            return user;
        }
        return new User();
    }
}
